home *** CD-ROM | disk | FTP | other *** search
- /*
-
- *********************************
- ReadMinoltaLS110 PC version
- *********************************
-
- C-routines that can be used to read out the Minolta LS-110/LS-100.
-
- Use at your own risk. Not for sale. May be distributed for non-commercial purposes.
- These routines are not provided by Minolta™ so don't contact them about it.
- Mac version by Frans W. Cornelissen, with suggestions from Eli Brenner.
- Copyrighted by Frans W. Cornelissen.
- PC version copyrighted by Erik van Wijk, Fysiology I, Erasmus University Rotterdam,
- The Netherlands. Contact him at wijk@fys1.fgg.eur.nl.
-
- This package should include
-
- read me file
- Minolta.c C routines for macintosh computer
- Minolta.h include file for mac
- ReadMinoltaLS110 small example program that works on my Quadra 610 and LC.
- In PC folder
- Minolta_PC.c routines that should work on pc
-
- Please send suggestions, bugs, improvements, comments to:
-
- Frans W. Cornelissen
- Laboratory for Experimental Ophthalmology (LEO)
- University of Groningen
- P.O. Box 30.001, 9700 RB Groningen, The Netherlands
- Tel: + 31 50 614173 (work)
- Fax: + 31 50 696743 (work)
- E-mail: f.w.cornelissen@med.rug.nl
-
- PC version by:
-
- Erik van Wijk vanwijk@fys1.fgg.eur.nl
- Vakgroep Fysiologie, EUR tel: +31-10-4087562
- Postbus 1738 fax: +31-10-4367594
- NL 3000 DR Rotterdam, The Netherlands
-
-
- *************************
- PC version
-
- Serial interface to LS100. In this software both assembly and borland c code is used
- to drive the serial port. Reading of characters is in assembler because the
- borland c bioscom influences the DTR line also. Setting of DTR line can only be
- done in assembly. Software only suitable for COM1(0) or COM2(1)
-
-
- Connector pin connections:
- Minolta: RS232 9 PIN:
-
- pin colour pin
- DATA red 2 (TD)
- MR white 4 (DTR)
- GND brown 5 (GND)
-
- Other connections
- RS232 9 PIN
- 7 to 8 (RTS to CTS)
- 1 to 6 and also to 4 (DCD to DSR to DTR)
- Minolta
- black to yellow (BSY to +5V)
-
- */
-
-
- #include <stdio.h>
- #include <bios.h>
- #include <conio.h>
- #include <dos.h>
- #include <time.h>
-
- #define _7DATABITS 0x02
- #define _2STOPBITS 0x04
- #define EVENPARITY 0x18
- #define _4800BAUD 0xC0
- #define DATA_READY 0x100
-
-
- void readlumdata(int COM,char * string);
- void initcom(int COM);
-
-
- void main()
- {
-
- int DONE=0;
- char string12[13];
-
-
- clrscr();
- initcom(1);
-
-
- while(!DONE)
- { if(kbhit())
- { getch();
- puts("go");
- readlumdata(1,string12);
- printf("%s",string12 );
- }
- }
- }
-
- void initcom(int COM)
- { if(COM) asm mov dx,2fch //force DTR/ and RTS/ low
- else asm mov dx,3fch
- asm{ mov al,0 //2=RTS 1=DTR
- out dx,al
- }
- bioscom(0, _4800BAUD | EVENPARITY | _2STOPBITS | _7DATABITS ,
- COM);
- }
-
-
- void readlumdata(int COM, char *string)
- {
- int i,status;
- char character;
- //alleen geschikt voor COM1 of COM2
- //geef signaal aan meter om meting te starten
- if(COM)asm mov dx,2fch //force DTR/ and RTS/ low
- else asm mov dx,3fch
- asm { mov al,1 //2=RTS 1=DTR
- out dx,al
- }
-
- for(i=0;i<11;i++)
- while(! ( (status = bioscom(3,0,COM)) & DATA_READY) );
- if(COM)asm mov dx,2f8h
- else asm mov dx,3f8h
- asm { in al,dx
- mov character,al
- }
- *(string+i)=(char)character;
-
- *(string+i)='\0';
- if (COM) asm mov dx,2fch
- else asm mov dx,3fch
- asm { mov al,0 //2=RTS 1=DTR
- out dx,al
- }
- }
-
-
-
-